﻿using Microsoft.Practices.Unity;
using YmtAuth.Domain.Repository;
using YmtAuth.Repository.MySQL;
using YmtSystem.CrossCutting;

namespace YmtAuth.AppService
{
    public class InitServiceTask : RegisterServiceBootstrapperTask
    {
        public InitServiceTask(IUnityContainer container) : base(container) { }

        public override TaskContinuation Execute()
        {
            container.RegisterType<IPasswordAppService, PasswordAppService>();
            container.RegisterType<IAuthAppService, AuthAppService>();
            container.RegisterType<IUserBillsAppService, UserBillsAppService>();
            container.RegisterType<IAuthQueryAppService, AuthQueryAppService>();
            container.RegisterTypeAsSingleton<ITokenAppService, TokenAppService>();
            container.RegisterType<ISecurityQuestionAppService, SecurityQuestionAppService>();
            container.RegisterType<IDualSecurityAppService, DualSecurityAppService>();
            container.RegisterType<ILoginSafeAppService, LoginSafeAppService>();

            container.RegisterType<IUserWhitelistRepository, UserWhitelistRepository>();

            return TaskContinuation.Continue;
        }
    }
}
